{include file="public/header" /}
<link href="{$Think.ADMIN_SITE_ROOT}/select2/select2.css" rel="stylesheet"/>
<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/select2/select2.full.min.js"></script>
<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/select2/zh-CN.js"></script>
<style>
    body{
        background: #FFF;
    }
    .page{
        min-height: auto;
    }
</style>
<div class="page">
    <form method="post">
        <table class="ds-default-table nobdb">
           <tr class="noborder">
                    <td class="required w120"><label class="validation">选择教程:</label></td>
                    <td class="vatop rowform">
                        <?php if(isset($course) &&!empty($course)){ ?>
                        <select name="course_id"  id="storeid" class="show-tick form-control">
                            <option value="">--请选择</option>
                            {foreach name="course" item="v"}
                            <option value="{$v.id}">{$v.title}</option>
                            {/foreach}
                        </select>
                        <?php }?>
                    </td>
                    <input type="hidden" name="goods_id" value="{$goods_id}">
                    <td class="vatop tips"></td>
                </tr>
                <tr  class="noborder" >
                    <td><input type="submit" value="提交"></td>
                    <td></td>
                    <td class="vatop tips"></td>
                </tr>
                
        </table>
    </form>
</div>
<script>

    $(document).ready(function () {
     $("#storeid").select2();
        $.extend($.validator.defaults,{ignore:""});
        $("#storeid").change(function(){
            $(this).valid();
        });

        $("form").submit(function (e) {

            var course_id =  $("#storeid").val();
            if(course_id==''){
                    layer.msg('请选择教程后提交');return false;
                }
            if(!res){
               return false;
            }
            

        });
    });




</script>